package com.ktjy.cn.aspect;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Random;

public class LogAspect {
    private Logger logger= LoggerFactory.getLogger(LogAspect.class);

    public void l1(){
        logger.info("开始自检");
        Random random = new Random();
        int num=random.nextInt(10);
        if(num<5){
            logger.info("自检成功");

        }else {
            throw new RuntimeException("自检失败");
        }
    }

    public void l2(){
        logger.info("运行成功");
    }
}
